Dictionaries

RapidSpell can use 2 different types of dictionary at once; the "main dictionary" and a "user dictionary".

Main Dictionary

Included are 5 dictionaries assemblies, AU, CA, UK and US English dictionaries, each containing ~110K words, a combined UK and US dictionary containing ~115K words. These are located in the Dictionaries folder under the install folder.

Keyoti offer a number of non-English dictionaries. Further details and evaluation versions are available at;

http://keyoti.com/products/rapidspell/dotNet/dictionaries.html

Choosing The Main Dictionary

As An Embedded Resource

Embedding the Dict File as a resource is the cleanest way to distribute the dictionary, the dictionary is included in your DLL or EXE, and does not have to be packaged separately. The only disadvantage is that the dictionary cannot be changed (using Dict Manager) without recompiling the application.

  1. Add the Dict File of your choice to your project (it can be the project that uses RapidSpell or a satellite assembly (provided the assembly is loaded into the App Domain (i.e. it's used) before spell checking starts).
  2. In the properties pane for the Dict File, set it as an Embedded Resource
  3. Set the DictFilePath in the spell check controls or RapidSpellChecker to the name of the Dict File (in the screen-shot that would be 'DICT-EN-UK-UKEnglish.2.dict')

Notes:

.NET 1 users must use uncompressed .dict files - which do not have ".2" in their file-name.

The spell checker will search for any resource in any loaded assembly containing the string in the DictFilePath property, therefore it's not necessary to specify the namespace or folder in which the resource is stored.

To reload the default dictionary use the name 'DICT-EN-US-USEnglish.2.default.dict' (.NET1 users should use 'DICT-EN-US-USEnglish.default.dict').

As An External File

With this style of usage you deploy the Dict File with your application as a separate file. You are in total control of how and where the Dict File is deployed, and must set the DictFilePath property of the controls to point to that location, ideally this should be done before the Check method is called (with RapidSpellDialog), to prevent redundant dictionary loading.

The DictFilePath property can be set as a relative path (relative to the EXE) or an absolute file path.

Dictionary Customization

It is possible to customize the dictionaries and create new ones using the convenient Dict Manager tool included in RapidSpell Desktop, please load the tool and consult the help system provided in it for more details.


The Dict Manager tool included in RapidSpell Desktop

User (Custom) Dictionaries / Add Button

To offer an "Add" function to the user, set the UserDictionaryFile property in either spell checking control to the file path where the dictionary should be stored (eg. "user-dictionary.txt"). If the file path specified is valid, the Add option will be enabled. If the file does not exist (but the path is valid) then the file will be created. The user dictionary is a simple UTF-8 text file with words listed one per line (it is not a .dict file and isn't created by 'Dict Manager'). The user dictionary is suited best to relatively short lists added to by the user. If a large list (order of thousands) of custom words needs to be added, it is suggested that they are added to the main dictionary using Dict Manager.

The Options form (via the 'Options...' button in the dialog spell check) allows the user to edit the user dictionary and also add/remove additional user dictionary files (except with TX Text Control). To prevent this, set ShowOptionForMultipleUserDictionaries=false in RapidSpellDialog or OptionsPresenter.

A Note About Main Dictionary Size

Understandably, many developers look to dictionary size as a metric for how good a spell checker is. However, the relationship is not that simple. There are many many words that can be grouped as part of the English language, especially when consideration is made for the history of English, how it has changed and been influenced by other languages (eg. French). If a spell checker dictionary is very large (ie hundreds of thousands of words) then it will include archaic and unusual spellings, scientific terms etc. which may be problematic during spell checking; a common misspelling may be accepted because it matches an unusual spelling or word. For example, consider "wonned", it is accepted by Merrium Webster as an archaic spelling for the past tense of "win". Clearly "wonned" is generally not acceptable in modern English, and it should be corrected as "won" - but a very large dictionary would accept it.